A quality photograph is a photograph where the contrast and luminosity of which are correctly adjusted. However, in a camera, the image sensor is typically adjusted in a global manner according to the measurements of the scene. This often results in overexposure of certain areas of the image and/or underexposure of certain other areas of the image. To improve the luminosity of a digital image, the tone curve of the image can be modified in a global manner.
In FIG. 1, the tone curve corresponds to a line in the form of a diagonal of a square. The line comprises a first end representative of a minimum pixel value and a second end representative of a maximum pixel value in the image involved. The boundaries 0 and MaxCode represent the values which the pixels can take according to their encoding, for example, if a pixel is encoded with 8 bits, it will be able to take 256 different values. According to the encoding, the minimum value of the pixels of the image, the coordinates of which are (0,0), represents a black pixel, and the maximum value represents a white pixel, the coordinates of which are (MaxCode, MaxCode).
By deforming the line between its first end (0,0) and its second end (MaxCode, MaxCode), it is possible to modify the shadows, the mid tones (gamma), and the highlights. Thus, if the details of the shadows are to be accentuated, they are lightened by curving the initial part of the line upwards. If the details of the highlights are to be accentuated, they are darkened by curving the final part of the line downwards. The first method tends to give rise to noise in the shadows, whereas the second method tends to reduce the contrast of the image. In order to adjust the contrast on a digital image, it is possible to modify the histogram of the image in a global manner.
In FIG. 2, the histogram enables the number of pixels to be visualized and counted according to their values. The dark pixels of the image are on the left of the histogram and the light pixels are on the right of the histogram. In general, each bar of the histogram represents a count of the pixels of the image having the same value representative of the associated bar.
To improve the contrast, stretching of the histogram of the image is often performed. In the example of FIG. 2, the histogram comprises few pixels having values close to 0 and few pixels having values close to MaxCode. Histogram stretching (also called “histogram linearization” or “range expansion”) comprises spreading the central area, which is the most “populated,” over the whole range of the histogram. The most representative intensities are thus distributed over the scale of available values. This has the effect of making the light pixels even lighter and the dark pixels close to black. This method does however have the effect of reducing the detail of the shadows and of the highlights.
In general, to improve visual perception, it is desirable for an image to be contrasted while at the same time providing a sufficient level of detail in the shadows and highlights. This involves improving the luminosity and contrast using the two techniques set out above. However, under difficult exposure conditions (for example, against the light), one of the techniques may cancel out the benefits of the other, in particular, when they are used in global manner on the image.
To improve this situation, techniques that act in a local manner are known. These can, for example, involve UnSharp Masking (USM) and the local contrast improvement technique, which is a variant of the USM technique. These techniques based on contour detection may however be complex to implement, especially in real time in a photographic camera.